package com.heaven.jane.sourcegenerator.commons.exception;

import lombok.Data;

/**
 * 业务异常
 * @author heaven
 *
 */
@Data
public class BusinessException extends Throwable {

	private static final long serialVersionUID = 1L;
	
	/**
	 * 错误编码
	 */
	private Long code;

	/**
	 * 构造对象
	 * @param code
	 * @return
	 */
	public static BusinessException build(Long code) {
		BusinessException exception = new BusinessException();
		exception.setCode(code);
		return exception;
	}

}
